{extend name="public:base" /}

{block name="css"}
<link rel="stylesheet" type="text/css" href="/static/sku-table/layui/css/layui.css"/>
<link href="__ADMIN__/css/style.css" rel="stylesheet">
{/block}
{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">

                    <form method="post" class="layui-form fairy-form">
                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">封面图</label>
                                <div class="col-sm-6">
                                    <input type="file" id="img_file" accept="image/*" style="display: none">
                                    <input type="hidden" class="hidden_value" name="img" id="img" value="{$info['img']|default=''}"/>
                                    <div class="btn btn-w-m btn-primary" onclick="uploadImage('img_file', 'img', 'form-uploaded-box-single', false, 1)">原图上传</div>
                                    <div class="btn btn-w-m btn-primary" onclick="openCrop('form-uploaded-box-single', 1)">裁剪上传</div>

                                    <div class="form-uploaded-box" id="form-uploaded-box-single" style="width: 140px">
                                        {if $info.img}
                                        <div class="form-uploaded-img-box">
                                            <img class="form-uploaded-box-img" src="{:getPicture($info.img)}" data-id="{$info.img}">
                                            <i class="form-uploaded-img-preview iconfont icon-yulan" onclick="previewImg(this, 'form-uploaded-img-preview', 'form-uploaded-box-single')"></i>
                                            <i class="form-uploaded-img-del iconfont icon-close" onclick="delImage(this, 'cropper_uploaded_img_ids', 'cropper_uploaded_img_paths', 'form-')"></i>
                                        </div>
                                        {/if}
                                    </div>
                                </div>

                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">券名称</label>
                                <div class="col-sm-3">
                                    <input type="text" name="name" placeholder="请输入优惠券名称" value="{$info['name']}" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">关联商品</label>
                                <div class="col-sm-3">
                                    <select class="form-control" name="goods_id">
                                        <option value="0">请选择商品</option>
                                        {volist name="goods_list" id="vo"}
                                        <option value="{$vo.id}" {if ($info.goods_id== $vo.id)}selected{/if}>{$vo.name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">每日抽奖数量</label>
                                <div class="col-sm-3">
                                    <input type="number" name="count" placeholder="请输入每日抽奖数量" value="{$info['count']}" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                    <button type="button" class="btn btn-w-m btn-primary ajax-post">提交</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/cropper-img-mask" cropper_uploaded_img_ids="cropper_uploaded_img_ids" cropper_uploaded_img_paths="cropper_uploaded_img_paths" crop_preview_box="crop-preview-box" /}

{include file="public/preview-img-mask" swiper-id="cropper-preview" /}
{/block}
{block name='js'}
<script type="text/javascript" src="/static/sku-table/layui/layui.js"></script>
{/block}

